﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Basic4Net.OAWeb.Main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="Scripts/Util.js"></script>
    <script type="text/javascript" src="Scripts/common.js"></script>
    <style type="text/css">
        div
        {
            _behavior: url("App_Themes/ui-lightness/iepngfix.htc");
        }
    </style>
    <script type="text/javascript">

        //显示年级升级对话框

        function Load() {
            //var type = EduType
        }

        //显示修改密码窗口
        function ShowUpdatePassword() {
            document.getElementById('pwd').value = '';
            document.getElementById('newpwd1').value = '';
            document.getElementById('newpwd2').value = '';
            //显示修改密码对话框        
            ShowPopForm("upPwdPop", "upPwdPopTitle", "修改密码");
            //显示背景遮罩
            showMask();
        }

        //关闭学期升级对话框
        function CloseMask(formId) {
            ClosePopForm(formId, true);
            hideMask();
        }

        //点击更新按钮
        function UpdatePassword() {
            var pwd = document.getElementById('pwd');
            var newpwd1 = document.getElementById('newpwd1');
            var newpwd2 = document.getElementById('newpwd2');
            if (pwd.value == "") {

                showNoticMsg('pwd', '密码不能为空');
                pwd.focus();
                return;
            }
            if (newpwd1.value == "") {
                showNoticMsg('newpwd1', '新密码不能为空');
                newpwd1.focus();
                return;
            }
            if (newpwd2.value == "") {
                showNoticMsg('newpwd2', '确认密码不能为空');
                newpwd2.focus();
                return;
            }

            if (getStringCount(pwd.value) > 20) {
                showNoticMsg('pwd', '密码不能大于20个字符');
                pwd.focus();
                return;
            }

            if (getStringCount(newpwd1.value) > 20) {
                showNoticMsg('newpwd1', '密码不能大于20个字符');
                newpwd1.focus();
                return;
            }

            if (getStringCount(newpwd2.value) > 20) {
                showNoticMsg('newpwd2', '密码不能大于20个字符');
                newpwd2.focus();
                return;
            }

            if (containSpecialChar(pwd.value) == true) {
                showNoticMsg('pwd', '密码不能含有特殊字符');
                pwd.focus();
                return;
            }

            if (containSpecialChar(newpwd1.value) == true) {
                showNoticMsg('newpwd1', '密码不能含有特殊字符');
                newpwd1.focus();
                return;
            }

            if (containSpecialChar(newpwd2.value) == true) {
                showNoticMsg('newpwd2', '密码不能含有特殊字符');
                newpwd2.focus();
                return;
            }


            if (newpwd2.value != newpwd1.value) {
                newpwd1.value = '';
                newpwd2.value = '';
                showNoticMsg('newpwd1', '新密码和确认密码必须相同');
                newpwd1.focus();
                return;
            }

            PageMethods.UpdatePwd(pwd.value, newpwd1.value, function (result) {

                if (result > 0) {
                    showMassgeBox("提示", '修改密码成功');
                    ClosePopForm('upPwdPop');
                }
                else if (result == -1) {
                    pwd.value = '';
                    showNoticMsg('pwd', '原密码不正确，请重新输入');
                    pwd.focus();
                }
                else {
                    pwd.value = '';
                    showNoticMsg('pwd', '修改密码失败，请重新修改');
                    pwd.focus();
                }

            }, function (err) {
                showMassgeBox("提示", UPDATEPWD_EXCEPTION, 1, null);
            });

        }

        function Format() {
            var c = document.body.scrollHeight;
            if ((c - 68 - 50) > 0) {
                document.getElementById("contentH").style.height = (c - 68 - 50) + "px";
                document.getElementById("leftFrame").style.height = (c - 68 - 50) + "px";
                document.getElementById("mainFrame").style.height = (c - 68 - 50) + "px";
            }
            //        alert(document.getElementById("div1").style.height);
        }

        function Navigate(userid,itemIndex) {
            switch (itemIndex) {
                case 1: //基础数据管理
                    PageMethods.ExistPermit(userid, 1, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "200px";
                            document.getElementById("div1").style.display = "inline";
                            document.getElementById("leftFrame").src = "Module_Base/Left.aspx";
                            document.getElementById("mainFrame").src = "Welcome.htm";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问《基础数据管理》！", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;

                case 2: //流程管理
                    PageMethods.ExistPermit(userid, 2, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "0px";
                            document.getElementById("div1").style.display = "none";
                            //document.getElementById("leftFrame").src = "Module_Process/Left.aspx";
                            document.getElementById("mainFrame").src = "Module_Process/main.aspx";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问《流程管理》！", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;

                case 3: //拨款管理
                    PageMethods.ExistPermit(userid, 3, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "200px";
                            document.getElementById("div1").style.display = "inline";
                            document.getElementById("leftFrame").src = "Module_Finance/Left.aspx";
                            document.getElementById("mainFrame").src = "Module_Finance/main.aspx";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问《拨款管理》！", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;
                case 4: //工作量管理
                    PageMethods.ExistPermit(userid, 4, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "200px";
                            document.getElementById("div1").style.display = "inline";
                            document.getElementById("leftFrame").src = "Module_Workload/Left.aspx";
                            document.getElementById("mainFrame").src = "Module_Workload/main.aspx";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问！《工作量管理》", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;
                case 5: //考勤管理
                    PageMethods.ExistPermit(userid, 5, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "200px";
                            document.getElementById("div1").style.display = "inline";
                            document.getElementById("leftFrame").src = "Module_Attendance/Left.aspx";
                            document.getElementById("mainFrame").src = "Module_Attendance/main.aspx";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问！《考勤管理》", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;
                case 6: //核算管理
                    PageMethods.ExistPermit(userid, 6, function (succ) {
                        if (succ) {
                            document.getElementById("div2").style.marginLeft = "200px";
                            document.getElementById("div1").style.display = "inline";
                            document.getElementById("leftFrame").src = "Module_Accounting/Left.aspx";
                            document.getElementById("mainFrame").src = "Module_Accounting/main.aspx";
                        }
                        else {
                            showMassgeBox("提示", "您没有足够的权限访问！《核算管理》", 1, null);
                        }
                    }, function (err) {
                        showMassgeBox("提示", "访问失败", 1, null);
                    })
                    break;
                case 7: //分析报表
                    document.getElementById("div2").style.marginLeft = "200px";
                    document.getElementById("div1").style.display = "inline";
                    document.getElementById("leftFrame").src = "Module_Report/Left.aspx";
                    document.getElementById("mainFrame").src = "Module_Report/main.aspx";
                    break;
            }
            var id = "li" + itemIndex;
            SetStyle(id);
        }

        function SetStyle(id) {
            document.getElementById(id).className = "avtive";
            var ass = document.getElementById('divTab').getElementsByTagName('a');
            if (ass != null) {
                for (var i = 0; i < ass.length; i++) {
                    var li = ass[i];
                    if (li.id != id) {
                        li.className = "";
                    }
                }
            }

        }

        function setSchoolName(schoolName) {
            document.getElementById("tdSchoolName").innerHTML = schoolName + " 基础数据管理";
        }
        function UpdateSchoolYearTerm(year, term) {
            var td = document.getElementById("tdSchoolTerm");
            var yearNext = year + 1;
            var strYear = year + "-" + yearNext + "学年";
            var strTerm = "";
            if (term == 1)
                strTerm = "上学期";
            else if (term == 2)
                strTerm = "下学期";
            td.innerText = "当前学期:" + strYear + strTerm;
        }

        function OpenDIV() {
            ShowPopForm("popTable", "formTitle", "个人信息", "");
        }
    </script>
</head>
<body scroll="no" onload="Load();" style="height: 100%" onresize="Format()">
    <form id="form1" runat="server" style="height: 100%">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
    </asp:ScriptManager>
    <div class="bodyWarp" style="height: 100%" id="c">
        <div class="pageHea">
            <div class="navHea">
                <table border="0" cellspacing="0" cellpadding="0" style="width: 99%;">
                    <tr>
                        <td rowspan="2" style="padding-top: 12px; width: 50%; font-family: 宋体;">
                            <h3 id="tdSchoolName">
                                罗芳中学绩效工资系统
                            </h3>
                        </td>
                        <td style="width: 50%; text-align: right;">
                            <a href="#" onclick="OpenDIV()">个人信息</a>
                            <%--<img src="App_Themes/ui-lightness/images/top_2.gif" align="absmiddle" style="float: none;" /><a
                                href="#" title="">首页</a>&nbsp;&nbsp;<img src="App_Themes/ui-lightness/images/updatepass.gif"
                                    align="absmiddle" style="float: none;" /><a href="javascript:ShowUpdatePassword()"
                                        title="">修改密码</a>&nbsp;&nbsp;<img src="App_Themes/ui-lightness/images/logout.gif"
                                            align="absmiddle" style="float: none;" />--%><a class="red" href="#" onclick="javascript:window.close();" title="">退出</a>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;" id="tdSchoolTerm">
                            当前学期:<%=GetProDateYear().ToString()+"年"+GetProDateMonth().ToString()+"月"+ GetProDateTerm() %>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="menuHea" id="divTab">
                <ul>
                    <li><a href="javascript:Navigate(<%=_userid %>,1)" id="li1" title="" class="avtive">基础数据管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,2)" id="li2" title="" >流程管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,3)" id="li3" title="" >拨款管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,4)" id="li4" title="" >工作量管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,5)" id="li5" title="" >考勤管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,6)" id="li6" title="" >核算管理</a></li>
                    <li><a href="javascript:Navigate(<%=_userid %>,7)" id="li7" title="" >分析报表</a></li>
                </ul>
            </div>
        </div>
        <div class="pageBody" id="contentH">
            <div class="pageLeft" id="div1">
                <iframe name="leftFrame" src="" style="height: 100%; width: 100%; overflow: auto;"
                    frameborder="0" marginwidth="0" marginheight="0"></iframe>
            </div>
            <div class="pageMain" id="div2">
                <iframe name="mainFrame" src="Welcome.htm" style="height: 100%; width: 100%" frameborder="0"
                    border="0" marginwidth="0" marginheight="0"></iframe>
            </div>
        </div>
        <div class="pageFoot">
            <a href="http://www.juwangtech.com/" title="武汉聚网科技有限公司" target="_blank">武汉聚网科技有限公司</a>
            版权所有 @2009 全国免费服务热线：800-713-6688 电子邮箱：service@juwangtech.com
        </div>
        <!--END-->
    </div>
    <div id="popTable" class="layoutWarp" style="display: none; width: 280px;overflow: inherit; ">
        <div class="title">
            <span id="formTitle">个人信息</span> <a title="关闭" onclick="ClosePopForm('popTable', true);">
                关闭</a>
        </div>
        <table id="PTableInfo" style="width: 95%; margin-top: 12px;" border="0" class="layoutTable">
            <tr>
                <td style="height:30px;width:50px;text-align:right">工号：
                </td>
                <td  style="text-align:left;">
                    <%=_teachcode %>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">姓名：
                </td>
                <td  style="text-align:left">
                    <%=_teachname %>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">分类：
                </td>
                <td  style="text-align:left">
                    <%=_typename %>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">职务：
                </td>
                <td  style="text-align:left">
                    <%=_postname %>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">职称：
                </td>
                <td  style="text-align:left">
                    <%=_positionname %>
                </td>
            </tr>
            <tr>
                <td style="text-align:right">权限：
                </td>
                <td  style="text-align:left">
                    <%=_permit %>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align:center">
                    <input id="btn_Exit" type="button" value="关闭" onclick="javascript:ClosePopForm('popTable', true)" class="commonBut" />
                </td>
            </tr>
        </table>
    </div>

    </form>
    <!-- 添加/修改题目分类弹出对话框 -->
<%--    <div id="upPwdPop" class="layoutWarp" style="display: none; width: 400px;">
        <div class="title">
            <span id="upPwdPopTitle"></span><a title="关闭" onclick="return ClosePopForm('upPwdPop')">
                关闭</a>
        </div>
        <table border="0" class="layoutTable">
            <tr>
                <td width="107" align="right">
                    原密码：
                </td>
                <td width="213" align="left">
                    <input onkeydown="" id="pwd" class="textInput" onfocus="" maxlength="20" type="password" />
                </td>
            </tr>
            <tr>
                <td width="107" align="right">
                    新密码：
                </td>
                <td width="213" align="left">
                    <input onkeydown="" id="newpwd1" class="textInput" onfocus="" maxlength="20" type="password" />
                </td>
            </tr>
            <tr>
                <td width="107" align="right">
                    确认新密码：
                </td>
                <td width="213" align="left">
                    <input onkeydown="" id="newpwd2" class="textInput" onfocus="" maxlength="20" type="password" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div align="center">
                        <input name="btnReqClsOK" type="button" class="commonBut" id="btnReqClsOK" onclick="UpdatePassword();"
                            value="确定" />
                        <input name="btnReqClsCancel" type="button" class="commonBut" id="btnReqClsCancel"
                            onclick="return CloseMask('upPwdPop')" value="取消" />
                    </div>
                </td>
            </tr>
        </table>
    </div>--%>
    <!--END-->
</body>
<script language="javascript" type="text/javascript">
    var c = document.body.scrollHeight;
    document.getElementById("contentH").style.height = (c - 68 - 58) + "px";
</script>
</html>
